<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>学生列表页面</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="../layui/css/layui.mobile.css" />
	<link rel="stylesheet" href="../layui/css/layui.css" />
	<link rel="stylesheet" href="../css/bootstrap.css" media="all" />
	<!--	<link rel="stylesheet" href="../layui/layui.js" />-->
	<script type="text/javascript" src="../js/public.js"></script>
</head>
<style>
	table,
	.layui-table th {
		text-align: center;
	}

	.layui-select-title input {
		height: 38px;
	}
</style>

<body>
	<!-- <blockquote class="layui-elem-quote layui-text" style="margin-bottom: 23px;">
		公司资源都具有员工保密协议签署，不允许公司员工将公司资源对接外界或转卖
	</blockquote> -->
	<!-- 手风琴 -->
	<div class="layui-collapse" lay-accordion="">
		<div class="layui-colla-item">
			<h2 class="layui-colla-title">搜索</h2>
			<!-- <div class="layui-colla-content layui-show"> -->
			<div class="layui-colla-content">

				<div class="demoTable">
					<form class="layui-form layui-form-pane">
						<div class="layui-form-item">
							<label class="layui-form-label">身份证</label>
							<div class="layui-input-inline">
								<input id="searchCardid" value="" style="height: 38px;" type="text" placeholder="请输入"
									class="layui-input" autocomplete="off">
							</div>
							<label class="layui-form-label">姓　名</label>
							<div class="layui-input-inline">
								<input id="searchName" value="" style="height: 38px;" type="text" placeholder="请输入"
									class="layui-input" autocomplete="off">
							</div>
							<label class="layui-form-label">院　校</label>
							<div class="layui-input-inline">
								<input id="searchSchool" value="" style="height: 38px;" type="text" placeholder="请输入"
									class="layui-input" autocomplete="off">
							</div>
						</div>
						<div class="layui-form-item" style="display: inline-block;">
							<label class="layui-form-label">缴费状态</label>
							<div class="layui-input-block" style="width: 190px;">
								<select id="ispayL">
									<option value="" selected="">全部</option>
									<option value="0">待缴费</option>
									<option value="1">已缴费</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item" style="display: inline-block;margin-left: 5px;">
							<label class="layui-form-label">报名状态</label>
							<div class="layui-input-block" style="width: 190px;">
								<select id="isApply">
									<option value="" selected="">全部</option>
									<option value="0">待报名</option>
									<option value="1">已报名</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item" style="display: inline-block;margin-left: 5px;">
							<label class="layui-form-label">省内 / 外</label>
							<div class="layui-input-block" style="width: 190px;">
								<select id="province">
									<option value="" selected="">全部</option>
									<option value="1">省内</option>
									<option value="2">省外</option>
								</select>
							</div>
						</div>

						<div class="layui-form-item">
							<div id="baominglaoshi" style="display: none;">
								<label class="layui-form-label">报名老师</label>
								<div class="layui-input-inline">
									<input id="searchTeacher" value="" style="height: 38px;width: 190px;" type="text"
										placeholder="请输入" class="layui-input">
								</div>
							</div>
							<label class="layui-form-label">录入时间</label>
							<div class="layui-input-inline">
								<input id="datetimepicker" value="" style="height: 38px;" type="text" placeholder="单击选择"
									class="layui-input">
							</div>

							<label class="layui-form-label">查询条数</label>
							<div class="layui-input-inline">
								<input id="tiaoshu" value="50" style="height: 38px;width: 190px;" type="text"
									placeholder="请输入一次性查询条数" class="layui-input">
							</div>
							<!-- <div class="layui-form-item" style="display: inline-block;">
								<label class="layui-form-label">统考课</label>
								<div class="layui-input-block" style="width: 190px;">
									<select id="searchUnifiedExam">
										<option value="" selected="">全部</option>
										<option value="1">有</option>
										<option value="0">无</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="display: inline-block;margin-left: 5px;">
								<label class="layui-form-label">论　文</label>
								<div class="layui-input-block" style="width: 190px;">
									<select id="searchPaper">
										<option value="" selected="">全部</option>
										<option value="1">有</option>
										<option value="0">无</option>
									</select>
								</div>
							</div> -->
						</div>
						<div class="layui-form-item">
							<div class="layui-form-item" style="display: inline-block;margin-top: -10px;">
								<label class="layui-form-label">统考课</label>
								<div class="layui-input-block" style="width: 190px;">
									<select id="searchUnifiedExam">
										<option value="" selected="">全部</option>
										<option value="1">有</option>
										<option value="0">无</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="display: inline-block;margin:-10px 0 0 5px;">
								<label class="layui-form-label">论　文</label>
								<div class="layui-input-block" style="width: 190px;">
									<select id="searchPaper">
										<option value="" selected="">全部</option>
										<option value="1">有</option>
										<option value="0">无</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="display: inline-block;margin:-10px 0 0 5px;">
								<label class="layui-form-label">学士学位</label>
								<div class="layui-input-block" style="width: 190px;">
									<select id="searchBaccalaureate">
										<option value="" selected="">全部</option>
										<option value="1">有</option>
										<option value="0">无</option>
									</select>
								</div>
							</div>
						</div>
					</form>
					<div>

						<a class="layui-btn layui-btn-radius" data-type="reload" id="selectbyCondition">搜 索</a>
						<button onclick="addStudentInfo();" class="layui-btn layui-btn-normal layui-btn-radius"
							data-toggle="modal" href="#mymodal-link" id="href-btn">添 加</button>
						<!--<button onclick="addStudentInfo();" class="layui-btn layui-btn-normal layui-btn-radius" data-toggle="modal" href="#mymodal-link" id="href-btn">批量更该报名老师</button>
							<button onclick="addStudentInfo();" class="layui-btn layui-btn-normal layui-btn-radius" data-toggle="modal" href="#mymodal-link" id="href-btn">批量删除学生</button>
							<button onclick="addStudentInfo();" class="layui-btn layui-btn-normal layui-btn-radius" data-toggle="modal" href="#mymodal-link" id="href-btn">批量缴费</button>-->
					</div>
				</div>

			</div>
		</div>
	</div>

	<!-- 模态窗口 -->
	<div style="display: none;" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
		aria-hidden="true" id="mymodal-link">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span
							aria-hidden="true">&times;</span><span class="sr-only"></span></button>
					<h4 class="modal-title">学生信息</h4>
				</div>
				<!-- <div class="modal-body text-center"> -->
				<div class="modal-body">

					<div class="text-right" style="width: 78%;height: auto;margin-top: 10px;">
						<div class="mb-3">
							<label for="name" class="form-label"
								style="display: inline-block;"><strong>姓　名：</strong></label>
							<input type="text" id="name" name="name" placeholder="姓名" value="">
						</div>
						<div class="mb-3">
							<label for="phone" class="form-label"
								style="display: inline-block;"><strong>手　机：</strong></label>
							<input type="text" id="phone" name="phone" placeholder="手机号码" value="">
						</div>
						<div class="mb-3">
							<label for="cardid" class="form-label"
								style="display: inline-block;"><strong>身份证：</strong></label>
							<input type="text" id="cardid" name="cardid" placeholder="身份证号码" value="">
						</div>
						<div class="mb-3">
							<label for="mail" class="form-label"
								style="display: inline-block;"><strong>邮　箱：</strong></label>
							<input type="text" id="mail" name="mail" placeholder="邮箱" value="">
						</div>
						<div class="mb-3">
							<label for="sosperson" class="form-label"
								style="display: inline-block;"><strong>紧急联系人：</strong></label>
							<input type="text" id="sosperson" name="sosperson" placeholder="紧急联系人姓名" value="">
						</div>
						<div class="mb-3">
							<label for="sosphone" class="form-label"
								style="display: inline-block;"><strong>紧急联系人手机：</strong></label>
							<input type="text" id="sosphone" name="sosphone" placeholder="紧急联系人手机" value="">
						</div>
						<div class="mb-3">
							<label for="school" class="form-label"
								style="display: inline-block;"><strong>院　校：</strong></label>
							<input type="text" id="school" name="school" placeholder="报考院校" value="">
						</div>
						<div class="mb-3">
							<label for="major" class="form-label"
								style="display: inline-block;"><strong>专　业：</strong></label>
							<input type="text" id="major" name="major" placeholder="专业" value="">
						</div>
						<div class="mb-3">
							<label for="educationType" class="form-label"
								style="display: inline-block;"><strong>学历类别：</strong></label>
							<select id="educationType" class="educationType">
							</select>
						</div>
						<div class="mb-3">
							<label for="cengci" class="form-label"
								style="display: inline-block;"><strong>考生层次：</strong></label>
							<select id="cengci" class="educationType">
							</select>
						</div>
						<div class="mb-3">
							<label for="money" class="form-label"
								style="display: inline-block;"><strong>缴费金额：</strong></label>
							<input type="number" id="money" name="money" placeholder="缴费金额" value="">
						</div>
						<div class="mb-3">
							<label for="oweafee" class="form-label"
								style="display: inline-block;"><strong>欠费金额：</strong></label>
							<input type="number" id="oweafee" name="oweafee" placeholder="欠费金额" value="100">
						</div>
						<div class="mb-3">
							<span id="chengben" style="display:none;">
								<label for="cb" class="form-label"
									style="display: inline-block;"><strong>成　本：</strong></label>
								<input type="text" id="cb" name="chengben" placeholder="成本" value="0">
							</span>
						</div>
						<div class="mb-3">
							<label for="remarks" class="form-label"
								style="display: inline-block;"><strong>备　注：</strong></label>
							<input type="number" id="remarks" name="remarks" placeholder="备注" value="">
						</div>
						<div class="mb-3">
							<label for="tname" class="form-label"
								style="display: inline-block;"><strong>报名老师：</strong></label>
							<select disabled id="tname" name="tname">
								<option value="0"></option>
							</select>
						</div>
						<div class="mb-3">
							<label for="unifiedExam" class="form-label"
								style="display: inline-block;"><strong>统考课：</strong></label>
							<input type="checkbox" id="unifiedExam" name="unifiedExam" style="margin:0% 49% 1% 0%;">
						</div>
						<div class="mb-3">
							<label for="paper" class="form-label"
								style="display: inline-block;"><strong>论　文：</strong></label>
							<input type="checkbox" id="paper" name="paper" style="margin:0% 49% 1% 0%;">
						</div>
						<div class="mb-3">
							<label for="baccalaureate" class="form-label"
								style="display: inline-block;"><strong>学士学位：</strong></label>
							<input type="checkbox" id="baccalaureate" name="baccalaureate" style="margin:0% 49% 1% 0%;">
						</div>
					</div>



					<!--户籍所在地 省市三级联动-->
					<!--学历层次 下拉框 高起专 专升本 高起本-->
					<input style="display: none;" type="text" name="addorupdate" value="">
					<input style="display: none;" type="text" name="id" value="">

				</div>
				<div class="modal-footer">
					<button id="closer" type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button id="save" type="button" class="btn btn-primary" data-dismiss="modal">提交</button>
				</div>
			</div>
		</div>
	</div>

	<table class="layui-hide" id="test" lay-filter="test" lay-data="{id: 'idTest'}"></table>

	<script type="text/javascript" src="../js/jquery-2.1.1.js"></script>

	<link rel="stylesheet" type="text/css" href="../datetimepicker/jquery.datetimepicker.css" />
	<script type="text/javascript" src="../datetimepicker/build/jquery.datetimepicker.full.min.js"></script>
	<script type="text/javascript" src="../layui/layui.all.js"></script>
	<script type="text/javascript" src="../js/bootstrap.js"></script>

	<script type="text/javascript" src="main.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script type="text/html" id="barDemo">

			<a class="layui-btn layui-btn-sm" lay-event="edit" data-toggle='modal' href='#mymodal-link'>编辑</a>
			{{# if(window.sessionStorage["scale"] == "4"||window.sessionStorage["scale"] == "1"){ }}
			<a class="layui-btn layui-btn-warm layui-btn-sm" lay-event="fapiao">发票</a>
			{{# } }} {{# if(window.sessionStorage["scale"] == "1" ){ }}
			<button class="layui-btn layui-btn-sm" lay-filter="ft{{d.id}}" lay-dropdown="{align:'right',menus:[{txt:'{{d.name}}'},{txt:'报名',event:'{{d.id}}-baoming'},{txt:'取消报名',event:'{{d.id}}-quxiao'},{txt:'缴费',event:'{{d.id}}-jiaofei'},{txt:'取消缴费',event:'{{d.id}}-qxjiaofei'},{txt:'确认返费',event:'{{d.id}}-isRefund'},{txt:'删除',event:'{{d.id}}-del'}]}">
	            <span>更多</span>
	            <i class="layui-icon layui-icon-triangle-d"></i>
           </button> {{# } }} {{# if(window.sessionStorage["scale"] == "4"){ }}
			<button class="layui-btn layui-btn-sm" lay-filter="ft{{d.id}}" lay-dropdown="{align:'right',menus:[{txt:'{{d.name}}'},{txt:'报名',event:'{{d.id}}-baoming'},{txt:'取消报名',event:'{{d.id}}-quxiao'},]}">
	            <span>更多</span>
	              <i class="layui-icon layui-icon-triangle-d"></i>
           </button> {{# } }}

		</script>

	<script>
		layui.use(['table', 'dropdown'], function () {
			var dropdown = layui.dropdown;
			var table = layui.table;
			/*初始化页面*/
			var tableIns = table.render({
				id: 'userTableReload',
				elem: '#test',
				url: bulicUrl + "adminselectAll.php",
				where: {
					condition: window.sessionStorage["condition"],
					scale: window.sessionStorage["scale"],
					userid: window.sessionStorage["userId"],
					tiaoshu: 50
				}, //如果无需传递额外参数，可不加该参数
				toolbar: true,
				title: '学员管理表',
				totalRow: true,
				cellMinWidth: 150,
				cols: [
					[{
						type: 'checkbox',
						field: 'left'
					},
					{
						field: 'id',
						title: 'ID',
						fixed: 'left',
						width: 62,
						hide: true
						/*unresize: true,
						sort: true,
						totalRowText: '合计行',
						totalRow: true,
						edit: 'text'
						totalRow: true introduce,*/

					}, {
						title: '序号',
						type: "numbers",
						width: 50,
					}, {
						field: 'name',
						title: '姓名',
						width: 72,
					},
					{
						field: 'cardid',
						title: '身份证号',
						width: 171,
						templet: function (d) {
							return '<span>' + d.cardid + '\t' + '</span>';
						}
					}, {
						field: 'phone',
						title: '手机',
						width: 117,
						templet: function (d) {
							return '<span>' + d.phone + '\t' + '</span>';
						}
					}, {
						field: 'tname',
						title: '报名老师',
						width: 86,
					}, {
						field: 'school',
						title: '院校',
						width: 117,
					}, {
						field: 'major',
						title: '专业',
					}, {
						field: 'educationType',
						title: '学历类型',
						width: 100,
						templet: function (d) {
							//获取学历类型
							var educationT = d.educationType;
							return map1.get(educationT);
						}
					}, {
						field: 'cengci',
						title: '考生层次',
						/*width: 171,*/
						templet: function (d) {
							return '<span>' + map7.get(d.cengci) + '\t' + '</span>';
						}
					}, {
						field: 'creattime',
						title: '录入时间',
						width: 200,
					}, {
						field: 'remarks',
						title: '备注',

					}, {
						field: 'ispay',
						title: '是否缴费',
						width: 86,
						templet: function (d) {
							if (d.ispay != 0) {
								return '<span style="color: red;">已缴费</span>';
							} else {
								return '未缴费';
							}
						}
					}, {
						field: 'money',
						title: '缴费金额',
						width: 86,
						hide: window.sessionStorage["scale"] != 1 ? true : false,
						templet: function (d) {
							return d.money > 0 ? '￥' + d.money : d.money
						}
					}, {
						field: 'oweafee',
						title: '欠费金额',
						width: 86,
						templet: function (d) {
							return d.oweafee != '0' ? '￥' + d.oweafee : d.oweafee
						}
					}, {
						field: 'Refund',
						title: '提成',
						width: 210,
						hide: window.sessionStorage["scale"] != 1 ? true : false,
						templet: function (d) {
							var str = d.isRefund != '0' ? '<span style="color:red"> 已发放</span>' : ' 未发放';
							return '<input disabled name="reFund" class="layui-input ticheng" autocomplete="off" value = "' + d.Refund + '" style="width:70px;display:inline;"/> <a id="' + d.id + '" style="display:inline-block;" class="layui-btn layui-btn-sm" lay-event="ticheng" onclick="updatedisfun(this);">确认</a>' + str
						}
					}, {
						field: 'isTi',
						title: '提交资料',
						width: 86,
						templet: function (d) {
							if (d.isTi == 0) {
								return '未提交';
							} else {
								return '<span style="color: red;">已提交</span>';
							}
						}
					}, {
						field: 'isBao',
						title: '报名',
						width: 86,
						templet: function (d) {
							if (d.isBao == 0) {
								return '未报名';
							} else {
								return '<span style="color: red;">已报名</span>';
							}
						}
					}, {
						field: 'unifiedExam',
						title: '统考课',
						width: 86,
						hide: true,
						templet: function (d) {
							if (d.unifiedExam == 0) {
								return '无';
							} else {
								return '<span style="color: red;">统考课</span>';
							}
						}
					}, {
						field: 'paper',
						title: '论文',
						width: 86,
						hide: true,
						templet: function (d) {
							if (d.paper == 0) {
								return '无';
							} else {
								return '<span style="color: red;">论文</span>';
							}
						}
					}, {
						field: 'baccalaureate',
						title: '学士学位',
						width: 86,
						hide: false,
						templet: function (d) {
							if (d.baccalaureate == 0) {
								return '无';
							} else {
								return '<span style="color: red;">学士学位</span>';
							}
						}
					}, {
						fixed: 'right',
						title: '操作',
						toolbar: '#barDemo',
						width: 215,
					}
					]
				],
				done: function (res, curr, count) {
					if (window.sessionStorage["scale"] == 1) {
						$('.ticheng').removeAttr("disabled");
					}
					//操作 更多 下拉
					dropdown.suite();
					//获取批量操作状态
					for (var i = 0; i < res.data.length; i++) {
						dropdown.onFilter("ft" + res.data[i].id, function (event) {
							//1654-baoming
							var arr = event.split("-");
							console.log(arr);

							switch (arr[1]) {
								case "baoming":
									layer.confirm('确定为该学员报名吗？', function (index) {
										isUpdata(arr[0], 1, batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});
									break;
								case "jiaofei":
									//batch返回批量操作参数
									layer.confirm('确定帮助选中学生缴费吗？', function (index) {
										isUpdata(arr[0], 2, batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});
									break;
								case "qxjiaofei":
									layer.confirm('确定取消学员缴费信息吗？', function (index) {
										isUpdata(arr[0], 4, batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});
									break;
								case "del":
									layer.confirm('确定删除学员信息吗？', function (index) {
										isUpdata(arr[0], 5, batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});
									break;
								case "isRefund":
									layer.confirm('确定给予返费吗？', function (index) {
										isRefund(arr[0], batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});

									break;
								case "quxiao":
									layer.confirm('确定取消学员报名吗？', function (index) {
										isUpdata(arr[0], 3, batch(table.checkStatus(tableIns.config.id)));
										layer.close(index);
									});
									break;
							}
						});
					}
				},
				page: false,
				request: {
					pageName: '1' // 页码的参数名称，默认：page
					,
					limitName: 'size' //每页数据量的参数名，默认：limit
				},
				response: {
					statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
				},
				parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
					return {
						"code": res.code, //解析接口状态
						"msg": res.msg, //解析提示文本
						"count": res.total, //解析数据长度
						"data": res.data //解析数据列表
					};
				},
				height: 650,

				text: {
					none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
				}
			});

			/*重新加载*/
			var $ = layui.$,
				active = {
					reload: function () {
						var tisohu = $("#tiaoshu").val();
						if ((tisohu) > 0) {

						} else {
							tisohu = 0
						}
						//执行重载
						table.reload('userTableReload', {
							where: {
								searchName: $("#searchName").val(),
								searchCardid: $("#searchCardid").val(),
								searchTeacher: $("#searchTeacher").val(),
								searchSchool: $("#searchSchool").val(),
								ispay: $("#ispayL").val(),
								isBao: $("#isApply").val(),
								createtime: $('#datetimepicker').val(),
								province: $('#province').val(),
								tiaoshu: tisohu,
								searchUnifiedExam: $('#searchUnifiedExam').val(),
								searchPaper: $('#searchPaper').val(),
								searchBaccalaureate: $('#searchBaccalaureate').val()
							}
						}, 'data');
					}
				};

			$('.demoTable .layui-btn').on('click', function () { //selectbyCondition
				// $('.demoTable #selectbyCondition').on('click', function () {
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});

			//监听复选框

			//监听行工具事件
			table.on('tool(test)', function (obj) {
				var that = this;
				var data = obj.data;
				if (obj.event === 'edit') {
					// if (window.sessionStorage["scale"] != 1) {
					//     if (data.ispay == 1) {
					//         $('#save').text('已缴费不能修改');
					//         $('#save').attr('disabled', 'disabled');
					//     } else {
					//         $('#save').text('提交');
					//         $('#save').removeAttr('disabled');
					//     }
					// }
					setDatal(data);
					setVal("addorupdate", 1); //0添加/1修改id
					setVal("id", data.id); //0添加/1修改id
					/*编辑*/
				} else if (obj.event === 'fapiao') {
					openBillView(data);
				}
			});

		});
	</script>
	<script>
		$('#datetimepicker').datetimepicker({
			format: 'Y年m月',
			validateOnBlur: false
		});
		$.datetimepicker.setLocale('zh');
		if (window.sessionStorage["scale"] == 1 || window.sessionStorage["scale"] == 4) {
			$('#baominglaoshi').css('display', 'inline-block');
			$('.ticheng').removeAttr("disabled");
		}
		/*初始化map1*/
		map1Function();
		map7Function();
	</script>

</body>

</html>